package com.pingan.haofang.searchcloud.common.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 操作结果
 *
 * @author baojie371
 * @date 17/5/10
 * @since 1.0.0
 */
@ApiModel(description = "操作结果")
public final class OperationResult {

    private OperationResult(boolean success, String reason) {
        this.success = success;
        this.reason = reason;
    }

    public static final OperationResult of(boolean success, String reason) {
        return new OperationResult(success, reason);
    }

    @ApiModelProperty("是否成功操作")
    private final boolean success;

    @ApiModelProperty("失败原因")
    private final String reason;

    public boolean isSuccess() {
        return success;
    }

    public String getReason() {
        return reason;
    }
}
